package com.example.vae.Dao.PersonData;

import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;


import com.example.vae.Pojo.Person;

import java.util.List;


//这个是 个人的Dao 层
@Dao
public interface PersonDao {
//    插入数据
    @Insert
    void insertPerson(Person... person);

//    更新用户
    @Update
    void updatePerson(Person... person);

//    查找所有用户信息
    @Query("SELECT * FROM person")
    List<Person> getAll();

    @Query("select * from person where personId =:person_id")
    LiveData<Person>  getPersonByID(int person_id);

}
